polywirelessfandomcom-20200214-history
Getting started on the ns-3 cluster
Navigation: Main -> ns-3 real-time -> Getting started on the cluster Installation and Log In For Windows Machines #Install a terminal emulator such as putty #Install a virtual network computing (VNC) viewer such as TightVNC . This will allow you to open a graphical window on the linux machine. #Configure putty to connect to the cluster: Note that each user will need to generally connect to a different port. (Two users can use the same port at the same time, but will then "share" the window meaning they see other's activity). The instructions below are for connecting to port 5901. However, you may wish to create configurations for other ports such as 5902, 5903, etc. since port 5901 may be used. ##In Session tab, under "Host Name (or IP address)" enter 128.238.34.207. ##In Connection->SSH->Tunnels: Under "Add a new forwarded port" for "Source port" enter 5901, and for "Destination" enter 128.238.34.207:5901. Then hit "Add" ##Return to the session tab, Give a name to the session, such as "Lab-cluster:5901" and hit "save". You will then be able to load this session again. #Once putty is configured, you can open the saved session. A terminal will appear. Enter your username and password. Contact Sundeep Rangan if you need an account on the system. #Once you are logged in, you need to start a vncserver process. You can see exsiting vnc server processes via ps -ef | grep Xvnc. Each vnc process has a port associated with it that you can see in the rfbport ''option. These processes may be from other users currently logged into the cluster. If you feel they are not being used, you can kill all the vnc processes via one of two ways: #*You can kill all the vnc processes via the command ''sudo pkill Xvnc. #*Or, you can find the individual process number from the ps -ef | grep Xvnc ''command and the kill just that process with ''sudo kill processid. #Select a port that is not currently being used. If this is not the port that you logged into, you will need to log out and connect again on the selected port. #Start your own vnc process via vncserver -geometry 1600x900 -rfbport 5901 &. Or whatever port number is not currently being used by other vncservers. #Start the tightVNC viewer. In remote host, enter localhost:5901. (Or, whatever port you are using). You will be prompted for a password. Note that the password is different than your account's password. Contact Sundeep Rangan if forgot this password. For Mac #Install SSH Tunnel Manager (STM) #Install a virtual network computing (VNC) viewer such as Chicken of the VNC #Configure STM to connect to the cluster: Note that each user will need to generally connect to a different port. (Two users can use the same port at the same time, but will then "share" the window meaning they see other's activity). The instructions below are for connecting to port 5901. However, you may wish to create configurations for other ports such as 5902, 5903, etc. since port 5901 may be used. Under Configuration: ##Set a name for your tunnel such as "Lab-cluster:5901" ##Type your username at the server. Contact Sundeep Rangan if you need an account on the system. ##Enter IP address of the server for host (128.238.34.207). ##Set the port to 22. ##Under Local redirections add a new redirection as this: Port (5901) Remote Host (128.238.34.207) Port (5901) ##Then you can close preferences window and switch to main (little) window of STM. ##Run the SSH tunnel that you created, which must be listed on main window. #Open a terminal and ssh to the lab cluster using command: user$ ssh username@128.23.8.34.207 #Enter your password. #Once you are logged in #*You need to start a vncserver process. You can see exsiting vnc server processes via ps -ef | grep Xvnc. Each vnc process has a port associated with it that you can see in the rfbport ''option. These processes may be from other users currently logged into the cluster. If you feel they are not being used, you can kill all the vnc processes via one of two ways: #**You can kill all the vnc processes via the command ''sudo pkill Xvnc. #**Or, you can find the individual process number from the ps -ef | grep Xvnc ''command and the kill just that process with ''sudo kill processid. #*Select a port that is not currently being used. If this is not the port that you logged into, you will need to log out and connect again on the selected port. #*Start your own vnc process via vncserver -geometry 1600x900 -rfbport 5901 &. Or whatever port number is not currently being used by other vncservers. #*After the first time you create your vns process it is going to ask you to set a password for it. You can use your account password for convenience. If you use something else, it is better to note it. # Start the Chicken of the VNC. In host, enter localhost:5901. (Or, whatever port you are using). Enter password and you can check Remember Password. Note that the password is the one you set when you first create the vnc process. Contact Sundeep Rangan if forgot this password. Setting up your account the first time Instructions to be added soon Downloading the Code and Creating the Project #Download the code using svn from http://chic.svn.sourceforge.net/svnroot/chic/lena and save it under ~/workspace/lena #* cd workspace // Change directory to ~/workspace #* svn co http://chic.svn.sourceforge.net/svnroot/chic/lena // svn checkout #Create a new C++ project using Eclipse IDE. (You can find it under /usr/bin) #Name it as "lena" and click on Next. #Under advance settings, C/C++ Build group: #* Uncheck "Use default build command" and change build command to ${workspace_loc:/lena}/waf #* Uncheck "Generate Makefiles automatically" #* Change build directory to ${workspace_loc:/lena/build/debug} #Under Behavior tab, uncheck "Build (Incremental Build)". We will build the project from the command line in a separate terminal, see commands below. Adding Bridges Bridges are already added. They can be used by all users if someone adds them. #Check if you can see tap-right and tap-left when you type ifconfig. #If you cannot see them then run these commands when you are in ~/workspace/lena #*sudo brctl addbr br-left #*sudo brctl addbr br-right #*sudo ifconfig br-left up #*sudo ifconfig br-right up #*sudo tunctl -t tap-left #*sudo tunctl -t tap-right #*sudo ifconfig tap-left 0.0.0.0 promisc up #*sudo ifconfig tap-right 0.0.0.0 promisc up #*sudo brctl addif br-left tap-left #*sudo brctl addif br-right tap-right #*sudo mount -t cgroup cgroup /cgroup #*sudo lxc-create -n left -f lxc-left.conf #*sudo lxc-create -n right -f lxc-right.conf Then you are good to go to next step. Running a Simple Demo As a simple illustration of the cluster, we will use the ns-3 software to connect two Linux virtual machines through the simulator -- one acting as if it is connected as a mobile user equipment (UE) in a LTE system. After connecting to the cluster (with putty and VNC Viewer), and after creating bridges: #Open a terminal window, let us call it main window. #Run commands: #*cd workspace/lena // to run waf shell #*sudo ./waf shell // to be able to run the code as root. It may ask you to run ./waf -d debug configure --enable-examples first #Then open two more terminal windows. Let us call one as left and the other one as right window. #On the left one, run these commands to start serving an iperf application #*sudo lxc-start -n left /bin/bash #*route add default gw 1.0.0.1 eth0 #*iperf -s -i1 -u // refer here for iperf options #On the right one, run these commands to start client #*sudo lxc-start -n right /bin/bash #*route add default gw 7.0.0.1 eth0 #*iperf -c 1.0.0.2 -i1 -u #Then go back to main window and run the command below: #*./waf --run "lena-simple-tap --simTime=30 --noisePower=0.00000000001" #After you finish your simulation, please exit from left and right.